import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        Solution solution = new Solution();
        System.out.println(solution.totalMoney(n));
    }
}

class Solution {
    public int totalMoney(int n) {
        int m = n / 7;
        int l = n % 7;
        if(m > 0){
          //return  (7*m*m + 49*m + l*l + 2*m*l + l) / 2;
            return  28 * m + (2 * m + 1 + l) * l / 2 + 7 * m * (m - 1) / 2;
        }else{
            return  28 * m + (2 * m + 1 + l) * l / 2;
        }
    }
}
